package com.starsoft.trade.bean;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TradePosition entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "trade_position")
public class TradePosition implements java.io.Serializable {

	// Fields

	private TradePositionId id;
	private Double secNum;
	private Double secValue;
	private Double secNumAfs;
	private Double totalCost;
	private Double profitDayMoney;
	private Date buyDate;

	// Constructors

	/** default constructor */
	public TradePosition() {
	}

	/** minimal constructor */
	public TradePosition(TradePositionId id) {
		this.id = id;
	}

	/** full constructor */
	public TradePosition(TradePositionId id, Double secNum, Double secValue, Double secNumAfs, Double totalCost,
			Double profitDayMoney, Date buyDate) {
		this.id = id;
		this.secNum = secNum;
		this.secValue = secValue;
		this.secNumAfs = secNumAfs;
		this.totalCost = totalCost;
		this.profitDayMoney = profitDayMoney;
		this.buyDate = buyDate;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({ @AttributeOverride(name = "acountId", column = @Column(name = "acountId", nullable = false)),
			@AttributeOverride(name = "asofdate", column = @Column(name = "asofdate", nullable = false, length = 10)),
			@AttributeOverride(name = "secId", column = @Column(name = "secId", nullable = false, length = 10)) })
	public TradePositionId getId() {
		return this.id;
	}

	public void setId(TradePositionId id) {
		this.id = id;
	}

	@Column(name = "secNum", precision = 22, scale = 0)
	public Double getSecNum() {
		return this.secNum;
	}

	public void setSecNum(Double secNum) {
		this.secNum = secNum;
	}

	@Column(name = "secValue", precision = 22, scale = 0)
	public Double getSecValue() {
		return this.secValue;
	}

	public void setSecValue(Double secValue) {
		this.secValue = secValue;
	}

	@Column(name = "secNumAfs", precision = 22, scale = 0)
	public Double getSecNumAfs() {
		return this.secNumAfs;
	}

	public void setSecNumAfs(Double secNumAfs) {
		this.secNumAfs = secNumAfs;
	}

	@Column(name = "totalCost", precision = 22, scale = 0)
	public Double getTotalCost() {
		return totalCost;
	}

	public void setTotalCost(Double totalCost) {
		this.totalCost = totalCost;
	}

	public Double getProfitDayMoney() {
		return profitDayMoney;
	}

	public void setProfitDayMoney(Double profitDayMoney) {
		this.profitDayMoney = profitDayMoney;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name = "buyDate", nullable = false, length = 10)
	public Date getBuyDate() {
		return this.buyDate;
	}

	public void setBuyDate(Date buyDate) {
		this.buyDate = buyDate;
	}
	
}